Skip to content

Fill Squeeze and Unsqueeze CUDA opset gaps to opset 25#27739

Merged
tianleiwu merged 3 commits intomainfrom
copilot/update-squeeze-unsqueeze-operators
Mar 19, 2026
Merged

Fill Squeeze and Unsqueeze CUDA opset gaps to opset 25#27739
tianleiwu merged 3 commits intomainfrom
copilot/update-squeeze-unsqueeze-operators

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 18, 2026

Description

Extends CUDA EP Squeeze and Unsqueeze kernel registrations from opset 23 to opset 25, matching CPU provider coverage.

  • squeeze.cc / unsqueeze.cc: Cap opset 23 to versioned 23–23, add versioned 24–24, add non-versioned 25
  • cuda_execution_provider.cc: Add corresponding forward declarations and BuildKernelCreateInfo registry entries for opsets 23 (now versioned), 24, and 25
  • docs/OperatorKernels.md: Update CUDA Squeeze and Unsqueeze entries to reflect 25+ coverage with individual 24 and 23 version rows

No new computation logic — these ops are shape-only (data is a cudaMemcpyAsync), so the same kernel implementation covers all new opsets.

Motivation and Context

CUDA EP registered Squeeze/Unsqueeze only up to opset 23 while the ONNX spec defines them through opset 25. Models exported at opset 24+ would fail to find a matching CUDA kernel. Part of the broader opset gap audit tracked in #27729.

Limitation

It does not include new data types for float8, float4, int4 etc. That will be added later if needed.

…pset 25

Co-authored-by: tianleiwu <30328909+tianleiwu@users.noreply.github.com>
@tianleiwu
Copy link
Copy Markdown
Contributor

/azp run Windows GPU Doc Gen CI Pipeline

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@tianleiwu
Copy link
Copy Markdown
Contributor

@copilot, please update docs/OperatorKernels.md, and merge latest main branch to this branch.

Copilot AI and others added 2 commits March 18, 2026 23:14
Co-authored-by: tianleiwu <30328909+tianleiwu@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 18, 2026

@copilot, please update docs/OperatorKernels.md, and merge latest main branch to this branch.

Done in a632a47 — updated docs/OperatorKernels.md with Squeeze/Unsqueeze CUDA entries showing 25+, 24, and 23 version rows, and merged latest main into this branch.

Copilot AI requested a review from tianleiwu March 18, 2026 23:16
@tianleiwu tianleiwu marked this pull request as ready for review March 18, 2026 23:47
@tianleiwu tianleiwu requested a review from Copilot March 19, 2026 17:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Extends CUDA Execution Provider kernel registrations for Squeeze and Unsqueeze to cover ONNX opsets 23–25, aligning CUDA coverage with CPU so models exported at opset 24+ can resolve CUDA kernels.

Changes:

  • Add CUDA kernel registrations for Squeeze/Unsqueeze opset 24 and opset 25+, and cap opset 23 to 23–23.
  • Update CUDA EP kernel registry declarations/registrations to match the new opset coverage.
  • Update operator kernel documentation entries to reflect the new version coverage rows.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
onnxruntime/core/providers/cuda/tensor/unsqueeze.cc Adds opset 23/24 versioned registrations and moves unversioned registration to opset 25+
onnxruntime/core/providers/cuda/tensor/squeeze.cc Adds opset 23/24 versioned registrations and moves unversioned registration to opset 25+
onnxruntime/core/providers/cuda/cuda_execution_provider.cc Updates forward declarations and kernel registry entries for opset 23–25 Squeeze/Unsqueeze
docs/OperatorKernels.md Updates CUDA doc table rows to show Squeeze/Unsqueeze coverage through opset 25+ with explicit 24 and 23 rows

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread onnxruntime/core/providers/cuda/cuda_execution_provider.cc
Comment thread onnxruntime/core/providers/cuda/cuda_execution_provider.cc
Comment thread onnxruntime/core/providers/cuda/cuda_execution_provider.cc
Comment thread docs/OperatorKernels.md
Comment thread docs/OperatorKernels.md
@tianleiwu tianleiwu merged commit 72d4605 into main Mar 19, 2026
93 checks passed
@tianleiwu tianleiwu deleted the copilot/update-squeeze-unsqueeze-operators branch March 19, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants